using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vt_ratesIntegrityMap : EntityTypeConfiguration<vt_ratesIntegrity>
    {
        public vt_ratesIntegrityMap()
        {
            // Primary Key
            this.HasKey(t => new { t.currency, t.HeaderView });

            // Properties
            this.Property(t => t.currency)
                .IsRequired()
                .HasMaxLength(5);

            this.Property(t => t.HeaderView)
                .IsRequired()
                .HasMaxLength(81);

            // Table & Column Mappings
            this.ToTable("vt_ratesIntegrity");
            this.Property(t => t.currency).HasColumnName("currency");
            this.Property(t => t.average_base_1).HasColumnName("average_base_1");
            this.Property(t => t.Min_base_1).HasColumnName("Min_base_1");
            this.Property(t => t.Max_base_1).HasColumnName("Max_base_1");
            this.Property(t => t.average_base_2).HasColumnName("average_base_2");
            this.Property(t => t.Min_base_2).HasColumnName("Min_base_2");
            this.Property(t => t.Max_base_2).HasColumnName("Max_base_2");
            this.Property(t => t.HeaderView).HasColumnName("HeaderView");
        }
    }
}
